import 'package:flutter/cupertino.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

class RefreshFooterView extends CustomFooter {
  RefreshFooterView({Key? key})
      : super(key: key, builder: (BuildContext context, LoadStatus? mode) {
    Widget body;
    if (mode == LoadStatus.idle) {
      body = const Text("上拉加载更多",
          style: TextStyle(color: Color(0xFF707070), fontSize: 12));
    } else if (mode == LoadStatus.loading) {
      body = const CupertinoActivityIndicator();
    } else if (mode == LoadStatus.failed) {
      body = const Text("加载失败!点击重试!",
          style: TextStyle(color: Color(0xFF707070), fontSize: 12));
    } else if (mode == LoadStatus.canLoading) {
      body = const Text("释放以加载更多",
          style: TextStyle(color: Color(0xFF707070), fontSize: 12));
    } else {
      body = const Text("没有更多数据了",
          style: TextStyle(color: Color(0xFF707070), fontSize: 12));
    }
    return SizedBox(
      height: 55.0,
      child: Center(child: body),
    );
  });

}